﻿using YDT_SeckillService.Domain.Entities;

namespace YDT_SeckillService.Domain.Interfaces
{
    /// <summary>
    /// 秒杀活动仓储接口 - 定义秒杀活动数据访问契约
    /// </summary>
    public interface ISeckillRepository
    {
        /// <summary>根据ID获取秒杀活动</summary>
        Task<Seckill?> GetByIdAsync(Guid id);
        /// <summary>根据日期获取秒杀活动</summary>
        Task<IEnumerable<Seckill>> GetByDateAsync(DateOnly date);
        /// <summary>获取所有秒杀活动</summary>
        Task<IEnumerable<Seckill>> GetAllAsync();
        /// <summary>获取正在进行中的秒杀活动</summary>
        Task<IEnumerable<Seckill>> GetActiveSeckillsAsync();
        /// <summary>获取即将开始的秒杀活动</summary>
        Task<IEnumerable<Seckill>> GetUpcomingSeckillsAsync();
        /// <summary>分页获取秒杀活动</summary>
        Task<(IEnumerable<Seckill> Seckills, int TotalCount)> GetPagedAsync(int pageIndex, int pageSize);
        /// <summary>添加秒杀活动</summary>
        Task AddAsync(Seckill seckill);
        /// <summary>更新秒杀活动</summary>
        Task UpdateAsync(Seckill seckill);
        /// <summary>删除秒杀活动</summary>
        Task DeleteAsync(Guid id);
        /// <summary>检查秒杀活动是否存在</summary>
        Task<bool> ExistsAsync(Guid id);
    }
}
